Eclipse Platform
Pre-release 3.0

org.eclipse.jface.text.source
Class AnnotationRulerColumn

java.lang.Object
  extended byorg.eclipse.jface.text.source.AnnotationRulerColumn
All Implemented Interfaces:
IVerticalRulerColumn
Direct Known Subclasses:
AnnotationColumn, OutlinerRulerColumn

public class AnnotationRulerColumn
extends Object
implements IVerticalRulerColumn

A vertical ruler column showing graphical representations of annotations. Will become final. Do not subclass.

Since:
2.0

Constructor Summary
AnnotationRulerColumn(IAnnotationModel model, int width)
          Constructs this column with the given arguments.
AnnotationRulerColumn(IAnnotationModel model, int width, IAnnotationAccess annotationAccess)
          Constructs this column with the given arguments.
AnnotationRulerColumn(int width)
          Constructs this column with the given width.
AnnotationRulerColumn(int width, IAnnotationAccess annotationAccess)
          Constructs this column with the given arguments.
 
Method Summary
 void addAnnotationType(Object annotationType)
          Adds the given annotation type to this annotation ruler column.
 Control createControl(CompositeRuler parentRuler, Composite parentControl)
          Creates the column's SWT control.
protected  void doPaint(GC gc)
          Draws the vertical ruler w/o drawing the Canvas background.
protected  void doPaint1(GC gc)
          Draws the vertical ruler w/o drawing the Canvas background.
protected  ITextViewer getCachedTextViewer()
          Returns the cached text viewer.
 Control getControl()
          Returns the column's SWT control.
protected  int getInclusiveTopIndexStartOffset()
          Returns the document offset of the upper left corner of the source viewer's viewport, possibly including partially visible lines.
protected  IAnnotationModel getModel()
          Returns this column's annotation model.
 int getWidth()
          Returns the width of this column's control.
protected  void mouseDoubleClicked(int rulerLine)
          Hook method for a mouse double click event on the given ruler line.
 void redraw()
          Redraws this column.
 void removeAnnotationType(Object annotationType)
          Removes the given annotation type from this annotation ruler column.
 void setFont(Font font)
          Sets the font of this ruler column.
 void setModel(IAnnotationModel model)
          Associates an annotation model with this ruler column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationRulerColumn

public AnnotationRulerColumn(IAnnotationModel model,
                             int width,
                             IAnnotationAccess annotationAccess)
Constructs this column with the given arguments.

Parameters:
width - the width of the vertical ruler
annotationAccess - the annotation access
Since:
3.0

AnnotationRulerColumn

public AnnotationRulerColumn(int width,
                             IAnnotationAccess annotationAccess)
Constructs this column with the given arguments.

Parameters:
width - the width of the vertical ruler
annotationAccess - the annotation access
Since:
3.0

AnnotationRulerColumn

public AnnotationRulerColumn(IAnnotationModel model,
                             int width)
Constructs this column with the given arguments.

Parameters:
width - the width of the vertical ruler

AnnotationRulerColumn

public AnnotationRulerColumn(int width)
Constructs this column with the given width.

Parameters:
width - the width of the vertical ruler
Method Detail

getControl

public Control getControl()
Description copied from interface: IVerticalRulerColumn
Returns the column's SWT control.

Specified by:
getControl in interface IVerticalRulerColumn
Returns:
the column's SWT control

getWidth

public int getWidth()
Description copied from interface: IVerticalRulerColumn
Returns the width of this column's control.

Specified by:
getWidth in interface IVerticalRulerColumn
Returns:
the width of this column's control

createControl

public Control createControl(CompositeRuler parentRuler,
                             Composite parentControl)
Description copied from interface: IVerticalRulerColumn
Creates the column's SWT control.

Specified by:
createControl in interface IVerticalRulerColumn
Parameters:
parentRuler - the parent ruler of this column
parentControl - the control of the parent ruler
Returns:
the column's SWT control

mouseDoubleClicked

protected void mouseDoubleClicked(int rulerLine)
Hook method for a mouse double click event on the given ruler line.

Parameters:
rulerLine - the ruler line

getInclusiveTopIndexStartOffset

protected int getInclusiveTopIndexStartOffset()
Returns the document offset of the upper left corner of the source viewer's viewport, possibly including partially visible lines.

Returns:
document offset of the upper left corner including partially visible lines

doPaint

protected void doPaint(GC gc)
Draws the vertical ruler w/o drawing the Canvas background.

Parameters:
gc - the gc to draw into

doPaint1

protected void doPaint1(GC gc)
Draws the vertical ruler w/o drawing the Canvas background. Implementation based on ITextViewerExtension3. Will replace doPaint(GC).

Parameters:
gc - the gc to draw into

redraw

public void redraw()
Description copied from interface: IVerticalRulerColumn
Redraws this column.

Specified by:
redraw in interface IVerticalRulerColumn

setModel

public void setModel(IAnnotationModel model)
Description copied from interface: IVerticalRulerColumn
Associates an annotation model with this ruler column. A value null is acceptable and clears the ruler.

Specified by:
setModel in interface IVerticalRulerColumn
Parameters:
model - the new annotation model, may be null

setFont

public void setFont(Font font)
Description copied from interface: IVerticalRulerColumn
Sets the font of this ruler column.

Specified by:
setFont in interface IVerticalRulerColumn
Parameters:
font - the new font of the ruler column

getCachedTextViewer

protected ITextViewer getCachedTextViewer()
Returns the cached text viewer.

Returns:
the cached text viewer

getModel

protected IAnnotationModel getModel()
Returns this column's annotation model.

Returns:
this column's annotation model

addAnnotationType

public void addAnnotationType(Object annotationType)
Adds the given annotation type to this annotation ruler column. Starting with this call, annotations of the given type are shown in this annotation ruler column.

Parameters:
annotationType - the annotation type
Since:
3.0

removeAnnotationType

public void removeAnnotationType(Object annotationType)
Removes the given annotation type from this annotation ruler column. Annotations of the given type are no longer shown in this annotation ruler column.

Parameters:
annotationType - the annotation type
Since:
3.0

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.